﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Utils
{
    public class Point
    {
        private double x;
        private double y;
        private double z;

        public Point()
        {
           
        }
        public Point(double x, double y)
        {
            this.x = x;
            this.y = y;
        }

        public Point(double x, double y, double z)
        {
            this.x = x;
            this.y = y;
            this.z = z;
        }
        public double X { get => x; set => x = value; }
        public double Y { get => y; set => y = value; }
        public double Z { get => z; set => z = value; }

        
        // 判断两点共线 
        public static bool Collineation(double x, double y, double X, double Y)
        {
            double norm = Vector.Norm(x, y);
            if (norm != 0)
            {
                if (x * Y - X * y == 0)
                {
                    return true;
                }
            }
            else
            {
                return true;
            }
            return false;
        }
        // 判断三点共线
        public static bool Collineation(double x, double y, double z, double X, double Y, double Z)
        {
            double norm = Vector.Norm(x, y, z);
            if (norm != 0)
            {
                if (x * Y - X * y == 0 && x * Z - X * z == 0 && y * Z - Y * z == 0)
                {
                    return true;
                }
            }
            else
            {
                return true;
            }
            return false;
        }
    }
}
